package com.jeevandeshmukh.glidetoast;

import com.jeevandeshmukh.glidetoast.slice.MainAbilitySlice;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.eventhandler.EventHandler;
import ohos.eventhandler.EventRunner;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ExampleOhosTest {
    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.jeevandeshmukh.glidetoast", actualBundleName);
    }


    @Test
    public void getToastDialogStart(){
        new EventHandler(EventRunner.getMainEventRunner()).postTask(() -> {
            MainAbilitySlice mainAbilitySlice = new MainAbilitySlice();
            mainAbilitySlice.startDialog();
            assertEquals(true, mainAbilitySlice.isProgress);
        });
    }
}